package com.icss.train_sys_back.mapper.ticket_manage;

import com.icss.train_sys_back.entity.ticket_manage.ChangeTicketEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author 小泽
 * @createTime 2025/10/7 18:29
 */
@Mapper
public interface ChangeTicketMapper {
    //改签记录分页+条件查询
    List<ChangeTicketEntity> getListConditions(String changeId, String orderId, String username, Integer status);

    //改签审核通过处理
    @Update("update t_change_ticket set status = #{updateStatus} , process_time = now() where change_id = #{changeId}")
    void updateStatus(String changeId, Integer updateStatus);

    //改签审核拒绝退票处理
    @Update("update t_change_ticket set status = 2 , process_time = now() , remark = #{remark} where change_id = #{changeId}")
    void updateStatusReject(String changeId, String remark);

    //改签记录添加
    void addRecord(ChangeTicketEntity changeTicket);
}
